import { useRouter } from 'next/router' import EditTraining from '../../../src/training/components/EditTraining' import { useTrainingQuery } from '../../../src/gql' const EditTrainingPage = () => { const router = useRouter() const { id } = router.query const training = useTrainingQuery({ variables: { id: typeof id === 'string' ? id : id[0] } }) if (training.loading) return

Loading data...

if (training.error) return

Error loading data.

console.log(training.data?.training) if (training.data?.training) return else return

Training {id} not found.

} export default EditTrainingPage